<template>
	<view class="upload">
<!-- web-view：用来承载网页的容器，自动铺满整个页面-->
		<web-view  v-if="appUrl" :src="appUrl">
		</web-view>
	</view>
</template>

<script>
	
	import {getToken} from '@/utils/token.js'
	export default {
		data() {
			return {
				appUrl:'',
				hasUrl:false,
				compName:'',
				compLogo:''
			}
		},
		
		onLoad:function(option){
			if(option.url){
				if(option.url.includes('mallCenterTwoMain')){
					this.appUrl = 'https://job.ydylmold.cn/mall/index.html#/mallCenterTwoMain?mn=djmall&mt=101&gt=4&tl=1'+`&usrNo=${getToken('userInfo')['craftsmanId']}&token=${getToken('token')}`
				}else{
					this.appUrl = option.url
				}
			
			}
			else if(option.obj){
				let item = JSON.parse(decodeURIComponent(option.obj))
				this.appUrl = item.webSrc
				this.compName = item.compName
				this.compLogo = item.compLogo
				this.hasUrl = true
			}else{
				this.appUrl = `https://www.ydylmold.cn/usrCenter/download`
			}
			// #ifdef H5
				window.location.href = this.appUrl
			// #endif
			
		}
	}
</script>

<style scoped>
	.con-left{
		display: flex;
		align-items: center;
	}
	.logo-img{
		width: 60rpx;
		height: 60rpx;
		border-radius: 50%;
	}
	.upload{
		width: 100%;
	}
</style>
